<template>
    <div class="app-container calendar-list-container">
        <!-- <div class="filter-container">
            <el-button v-if="shop_store_add" class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="edit">添加
            </el-button>
        </div> -->
        <div class="filter-container">
            <!-- <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="用户名" v-model="listQuery.username">
            </el-input>
            <el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>-->
           <el-button v-if="shop_store_add" class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="edit">添加</el-button> 

            <!-- <el-button v-if="shop_store_add" class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="edit">添加</el-button> -->
        </div>
        <el-table :key='tableKey' :data="list" v-loading="listLoading" element-loading-text="给我一点时间" border fit
                  highlight-current-row style="width: 100%">
            <el-table-column align="center" label="店铺索引id">
                <template scope="scope">
                    <span>{{ scope.row.storeId }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺名称">
                <template scope="scope">
                    <span>{{ scope.row.storeName }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺认证">
                <template scope="scope">
                    <span>{{ scope.row.storeAuth }}</span>
                </template>
            </el-table-column>
             <!-- <el-table-column align="center" label="店铺认证,0-未认证，1-认证">
                <template scope="scope">
                    <span>{{ scope.row.storeAuth }}</span>
                </template>
            </el-table-column> -->
            <!-- <el-table-column align="center" label="店主认证，0-未认证，1-认证">
                <template scope="scope">
                    <span>{{ scope.row.ownerAuth }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺等级">
                <template scope="scope">
                    <span>{{ scope.row.gradeId }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="会员id">
                <template scope="scope">
                    <span>{{ scope.row.userId }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="会员名称">
                <template scope="scope">
                    <span>{{ scope.row.userName }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="身份证">
                <template scope="scope">
                    <span>{{ scope.row.storeOwnerCard }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺分类">
                <template scope="scope">
                    <span>{{ scope.row.scId }}</span>
                </template>
            </el-table-column> -->
            <!-- <el-table-column align="center" label="地区id">
                <template scope="scope">
                    <span>{{ scope.row.areaId }}</span>
                </template>
            </el-table-column> -->
            <!-- <el-table-column align="center" label="地区内容，冗余数据">
                <template scope="scope">
                    <span>{{ scope.row.areaInfo }}</span>
                </template>
            </el-table-column> -->
            <el-table-column align="center" label="详细地区">
                <template scope="scope">
                    <span>{{ scope.row.storeAddress }}</span>
                </template>
            </el-table-column>
            <!-- <el-table-column align="center" label="邮政编码">
                <template scope="scope">
                    <span>{{ scope.row.storeZip }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="电话号码">
                <template scope="scope">
                    <span>{{ scope.row.storeTel }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="短信接口字段">
                <template scope="scope">
                    <span>{{ scope.row.storeSms }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="证件上传">
                <template scope="scope">
                    <span>{{ scope.row.storeImage }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="执照上传">
                <template scope="scope">
                    <span>{{ scope.row.storeImage1 }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺状态，0关闭，1开启，2审核中">
                <template scope="scope">
                    <span>{{ scope.row.storeState }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺关闭原因">
                <template scope="scope">
                    <span>{{ scope.row.storeCloseInfo }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺排序">
                <template scope="scope">
                    <span>{{ scope.row.storeSort }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺时间">
                <template scope="scope">
                    <span>{{ scope.row.storeTime }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="">
                <template scope="scope">
                    <span>{{ scope.row.endTime }}</span>
                </template>
            </el-table-column> -->
            <el-table-column align="center" label="店铺logo">
                <template scope="scope">
                    <span>{{ scope.row.storeLabel }}</span>
                </template>
            </el-table-column>
            <!-- <el-table-column align="center" label="店铺门脸照">
                <template scope="scope">
                    <span>{{ scope.row.storeBanner }}</span>
                </template>
            </el-table-column> -->
            <el-table-column align="center" label="店铺logo">
                <template scope="scope">
                    <span>{{ scope.row.storeLogo }}</span>
                </template>
            </el-table-column>
            <!-- <el-table-column align="center" label="店铺seo关键字">
                <template scope="scope">
                    <span>{{ scope.row.storeKeywords }}</span>
                </template>
            </el-table-column> -->
            <el-table-column align="center" label="店铺展示视频">
                <template scope="scope">
                    <span>{{ scope.row.storeDisplayVideo }}</span>
                </template>
            </el-table-column>
            <!-- <el-table-column align="center" label="店铺seo描述">
                <template scope="scope">
                    <span>{{ scope.row.storeDescription }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="QQ">
                <template scope="scope">
                    <span>{{ scope.row.storeQq }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="阿里旺旺">
                <template scope="scope">
                    <span>{{ scope.row.storeWw }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺简介">
                <template scope="scope">
                    <span>{{ scope.row.description }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="主营商品">
                <template scope="scope">
                    <span>{{ scope.row.storeMainGoods }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺二级域名">
                <template scope="scope">
                    <span>{{ scope.row.storeDomain }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="二级域名修改次数">
                <template scope="scope">
                    <span>{{ scope.row.storeDomainTimes }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="推荐，0为否，1为是，默认为0">
                <template scope="scope">
                    <span>{{ scope.row.storeRecommend }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺当前主题">
                <template scope="scope">
                    <span>{{ scope.row.storeTheme }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺信用">
                <template scope="scope">
                    <span>{{ scope.row.storeCredit }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺好评率">
                <template scope="scope">
                    <span>{{ scope.row.praiseRate }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="是否删除，0否，1是">
                <template scope="scope">
                    <span>{{ scope.row.isDel }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="描述相符度分数">
                <template scope="scope">
                    <span>{{ scope.row.storeDesccredit }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="服务态度分数">
                <template scope="scope">
                    <span>{{ scope.row.storeServicecredit }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="发货速度分数">
                <template scope="scope">
                    <span>{{ scope.row.storeDeliverycredit }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺二维码">
                <template scope="scope">
                    <span>{{ scope.row.storeCode }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺收藏数量">
                <template scope="scope">
                    <span>{{ scope.row.storeCollect }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺幻灯片">
                <template scope="scope">
                    <span>{{ scope.row.storeSlide }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺幻灯片链接">
                <template scope="scope">
                    <span>{{ scope.row.storeSlideUrl }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="卖家中心的常用操作快捷链接">
                <template scope="scope">
                    <span>{{ scope.row.storeCenterQuicklink }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺印章">
                <template scope="scope">
                    <span>{{ scope.row.storeStamp }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="打印订单页面下方说明文字">
                <template scope="scope">
                    <span>{{ scope.row.storePrintdesc }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺销量">
                <template scope="scope">
                    <span>{{ scope.row.storeSales }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="售前客服">
                <template scope="scope">
                    <span>{{ scope.row.storePresales }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="售后客服">
                <template scope="scope">
                    <span>{{ scope.row.storeAftersales }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="工作时间">
                <template scope="scope">
                    <span>{{ scope.row.storeWorkingtime }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺坐在市id">
                <template scope="scope">
                    <span>{{ scope.row.cityId }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺所在地（省）">
                <template scope="scope">
                    <span>{{ scope.row.provinceId }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺点击量">
                <template scope="scope">
                    <span>{{ scope.row.storeClick }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="">
                <template scope="scope">
                    <span>{{ scope.row.storecreateTime }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="当前登陆时间">
                <template scope="scope">
                    <span>{{ scope.row.storeLogintime }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="上次登陆时间">
                <template scope="scope">
                    <span>{{ scope.row.storeLastlogintime }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="经度">
                <template scope="scope">
                    <span>{{ scope.row.storeLongitude }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="纬度">
                <template scope="scope">
                    <span>{{ scope.row.storeAtitude }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="银行开户名">
                <template scope="scope">
                    <span>{{ scope.row.bankAccountName }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="公司银行账号">
                <template scope="scope">
                    <span>{{ scope.row.bankAccountNumber }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="开户银行支行名称">
                <template scope="scope">
                    <span>{{ scope.row.bankName }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="支行联行号">
                <template scope="scope">
                    <span>{{ scope.row.bankCode }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="支付宝姓名">
                <template scope="scope">
                    <span>{{ scope.row.alipayName }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="支付宝账号名">
                <template scope="scope">
                    <span>{{ scope.row.alipayAccountNumber }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="微信姓名">
                <template scope="scope">
                    <span>{{ scope.row.weichatName }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="微信账号">
                <template scope="scope">
                    <span>{{ scope.row.weichatAccountNumber }}</span>
                </template>
            </el-table-column> -->
            <!-- <el-table-column align="center" label="店铺类型ID">
                <template scope="scope">
                    <span>{{ scope.row.typeId }}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="店铺类型名称">
                <template scope="scope">
                    <span>{{ scope.row.typeName }}</span>
                </template>
            </el-table-column> -->
            <el-table-column align="center" label="地区code">
                <template scope="scope">
                    <span>{{ scope.row.areaCode }}</span>
                </template>
            </el-table-column>
            <!-- <el-table-column align="center" label="">
                <template scope="scope">
                    <span>{{ scope.row.areaDetail }}</span>
                </template>
            </el-table-column> -->
            <el-table-column align="center" label="操作" width="300">
                <template slot-scope="scope">
                    
                    <el-button v-if="shop_store_upd" size="small" type="success" @click="handleUpdate(scope.row)">编辑
                    </el-button>
                    <el-button  size="small" type="warning">
                        <router-link to="/shopAuditing/index">审核</router-link>                    
                    </el-button>
                    <el-button v-if="shop_store_del" size="small" type="danger" @click="handleDelete(scope.row)">删除
                    </el-button>
                </template>
            </el-table-column>
        </el-table>


        <div v-show="!listLoading" class="pagination-container">
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                           :current-page.sync="listQuery.page"
                           :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit"
                           layout="total, sizes, prev, pager, next, jumper" :total="total">
            </el-pagination>
        </div>
        <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
            <el-form :model="form" :rules="rules" ref="form" label-width="100px">
                    <el-form-item label="店铺索引id" prop="storeId">
                        <el-input v-model="form.storeId" placeholder="店铺索引id"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺名称" prop="storeName">
                        <el-input v-model="form.storeName" placeholder="店铺名称"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺认证" prop="storeAuth">
                        <el-input v-model="form.storeAuth" placeholder="店铺认证,0-未认证，1-认证"></el-input>
                    </el-form-item>
                    <!-- <el-form-item label="店铺认证,0-未认证，1-认证" prop="username">
                        <el-input v-model="form.storeAuth" placeholder="店铺认证,0-未认证，1-认证"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="店主认证，0-未认证，1-认证" prop="username">
                        <el-input v-model="form.ownerAuth" placeholder="店主认证，0-未认证，1-认证"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺等级" prop="username">
                        <el-input v-model="form.gradeId" placeholder="店铺等级"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="会员id" prop="username">
                        <el-input v-model="form.userId" placeholder="会员id"></el-input>
                    </el-form-item>
                    <el-form-item label="会员名称" prop="username">
                        <el-input v-model="form.userName" placeholder="会员名称"></el-input>
                    </el-form-item>
                    <el-form-item label="身份证" prop="username">
                        <el-input v-model="form.storeOwnerCard" placeholder="身份证"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺分类" prop="username">
                        <el-input v-model="form.scId" placeholder="店铺分类"></el-input>
                    </el-form-item> -->
                    <el-form-item label="地区id" prop="areaId">
                        <el-input v-model="form.areaId" placeholder="地区id"></el-input>
                    </el-form-item>
                    <!-- <el-form-item label="地区内容，冗余数据" prop="username">
                        <el-input v-model="form.areaInfo" placeholder="地区内容，冗余数据"></el-input>
                    </el-form-item> -->
                    <el-form-item label="详细地区" prop="storeAddress">
                        <el-input v-model="form.storeAddress" placeholder="详细地区"></el-input>
                    </el-form-item>
                    <!-- <el-form-item label="邮政编码" prop="username">
                        <el-input v-model="form.storeZip" placeholder="邮政编码"></el-input>
                    </el-form-item>
                    <el-form-item label="电话号码" prop="username">
                        <el-input v-model="form.storeTel" placeholder="电话号码"></el-input>
                    </el-form-item>
                    <el-form-item label="短信接口字段" prop="username">
                        <el-input v-model="form.storeSms" placeholder="短信接口字段"></el-input>
                    </el-form-item>
                    <el-form-item label="证件上传" prop="username">
                        <el-input v-model="form.storeImage" placeholder="证件上传"></el-input>
                    </el-form-item>
                    <el-form-item label="执照上传" prop="username">
                        <el-input v-model="form.storeImage1" placeholder="执照上传"></el-input>
                    </el-form-item> 
                    <el-form-item label="店铺状态，0关闭，1开启，2审核中" prop="username">
                        <el-input v-model="form.storeState" placeholder="店铺状态，0关闭，1开启，2审核中"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺关闭原因" prop="username">
                        <el-input v-model="form.storeCloseInfo" placeholder="店铺关闭原因"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺排序" prop="username">
                        <el-input v-model="form.storeSort" placeholder="店铺排序"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺时间" prop="username">
                        <el-input v-model="form.storeTime" placeholder="店铺时间"></el-input>
                    </el-form-item>
                    <el-form-item label="" prop="username">
                        <el-input v-model="form.endTime" placeholder=""></el-input>
                    </el-form-item>-->
                    <!-- <el-form-item label="店铺logo" prop="storeLabel">
                        <el-input v-model="form.storeLabel" placeholder="店铺logo"></el-input>
                    </el-form-item> -->
                    <!-- <el-form-item label="店铺门脸照" prop="username">
                        <el-input v-model="form.storeBanner" placeholder="店铺门脸照"></el-input>
                    </el-form-item> -->
                    <el-form-item label="店铺logo" prop="storeLogo">
                        <el-input v-model="form.storeLogo" placeholder="店铺logo"></el-input>
                    </el-form-item>
                    <!-- <el-form-item label="店铺seo关键字" prop="username">
                        <el-input v-model="form.storeKeywords" placeholder="店铺seo关键字"></el-input>
                    </el-form-item> -->
                    <el-form-item label="店铺展示视频" prop="storeDisplayVideo">
                        <el-input v-model="form.storeDisplayVideo" placeholder="店铺展示视频"></el-input>
                    </el-form-item>
                    <!-- <el-form-item label="店铺seo描述" prop="username">
                        <el-input v-model="form.storeDescription" placeholder="店铺seo描述"></el-input>
                    </el-form-item>
                    <el-form-item label="QQ" prop="username">
                        <el-input v-model="form.storeQq" placeholder="QQ"></el-input>
                    </el-form-item>
                    <el-form-item label="阿里旺旺" prop="username">
                        <el-input v-model="form.storeWw" placeholder="阿里旺旺"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺简介" prop="username">
                        <el-input v-model="form.description" placeholder="店铺简介"></el-input>
                    </el-form-item>
                    <el-form-item label="主营商品" prop="username">
                        <el-input v-model="form.storeMainGoods" placeholder="主营商品"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺二级域名" prop="username">
                        <el-input v-model="form.storeDomain" placeholder="店铺二级域名"></el-input>
                    </el-form-item>
                    <el-form-item label="二级域名修改次数" prop="username">
                        <el-input v-model="form.storeDomainTimes" placeholder="二级域名修改次数"></el-input>
                    </el-form-item>
                    <el-form-item label="推荐，0为否，1为是，默认为0" prop="username">
                        <el-input v-model="form.storeRecommend" placeholder="推荐，0为否，1为是，默认为0"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺当前主题" prop="username">
                        <el-input v-model="form.storeTheme" placeholder="店铺当前主题"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺信用" prop="username">
                        <el-input v-model="form.storeCredit" placeholder="店铺信用"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺好评率" prop="username">
                        <el-input v-model="form.praiseRate" placeholder="店铺好评率"></el-input>
                    </el-form-item>
                    <el-form-item label="是否删除，0否，1是" prop="username">
                        <el-input v-model="form.isDel" placeholder="是否删除，0否，1是"></el-input>
                    </el-form-item>
                    <el-form-item label="描述相符度分数" prop="username">
                        <el-input v-model="form.storeDesccredit" placeholder="描述相符度分数"></el-input>
                    </el-form-item>
                    <el-form-item label="服务态度分数" prop="username">
                        <el-input v-model="form.storeServicecredit" placeholder="服务态度分数"></el-input>
                    </el-form-item>
                    <el-form-item label="发货速度分数" prop="username">
                        <el-input v-model="form.storeDeliverycredit" placeholder="发货速度分数"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺二维码" prop="username">
                        <el-input v-model="form.storeCode" placeholder="店铺二维码"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺收藏数量" prop="username">
                        <el-input v-model="form.storeCollect" placeholder="店铺收藏数量"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺幻灯片" prop="username">
                        <el-input v-model="form.storeSlide" placeholder="店铺幻灯片"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺幻灯片链接" prop="username">
                        <el-input v-model="form.storeSlideUrl" placeholder="店铺幻灯片链接"></el-input>
                    </el-form-item>
                    <el-form-item label="卖家中心的常用操作快捷链接" prop="username">
                        <el-input v-model="form.storeCenterQuicklink" placeholder="卖家中心的常用操作快捷链接"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺印章" prop="username">
                        <el-input v-model="form.storeStamp" placeholder="店铺印章"></el-input>
                    </el-form-item>
                    <el-form-item label="打印订单页面下方说明文字" prop="username">
                        <el-input v-model="form.storePrintdesc" placeholder="打印订单页面下方说明文字"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺销量" prop="username">
                        <el-input v-model="form.storeSales" placeholder="店铺销量"></el-input>
                    </el-form-item>
                    <el-form-item label="售前客服" prop="username">
                        <el-input v-model="form.storePresales" placeholder="售前客服"></el-input>
                    </el-form-item>
                    <el-form-item label="售后客服" prop="username">
                        <el-input v-model="form.storeAftersales" placeholder="售后客服"></el-input>
                    </el-form-item>
                    <el-form-item label="工作时间" prop="username">
                        <el-input v-model="form.storeWorkingtime" placeholder="工作时间"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺坐在市id" prop="username">
                        <el-input v-model="form.cityId" placeholder="店铺坐在市id"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺所在地（省）" prop="username">
                        <el-input v-model="form.provinceId" placeholder="店铺所在地（省）"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺点击量" prop="username">
                        <el-input v-model="form.storeClick" placeholder="店铺点击量"></el-input>
                    </el-form-item>
                    <el-form-item label="" prop="username">
                        <el-input v-model="form.storecreateTime" placeholder=""></el-input>
                    </el-form-item>
                    <el-form-item label="当前登陆时间" prop="username">
                        <el-input v-model="form.storeLogintime" placeholder="当前登陆时间"></el-input>
                    </el-form-item>
                    <el-form-item label="上次登陆时间" prop="username">

                        <el-input v-model="form.storeLastlogintime" placeholder="上次登陆时间"></el-input>
                    </el-form-item>
                    <el-form-item label="经度" prop="username">
                        <el-input v-model="form.storeLongitude" placeholder="经度"></el-input>
                    </el-form-item>
                    <el-form-item label="纬度" prop="username">
                        <el-input v-model="form.storeAtitude" placeholder="纬度"></el-input>
                    </el-form-item>
                    <el-form-item label="银行开户名" prop="username">
                        <el-input v-model="form.bankAccountName" placeholder="银行开户名"></el-input>
                    </el-form-item>
                    <el-form-item label="公司银行账号" prop="username">
                        <el-input v-model="form.bankAccountNumber" placeholder="公司银行账号"></el-input>
                    </el-form-item>
                    <el-form-item label="开户银行支行名称" prop="username">
                        <el-input v-model="form.bankName" placeholder="开户银行支行名称"></el-input>
                    </el-form-item>
                    <el-form-item label="支行联行号" prop="username">
                        <el-input v-model="form.bankCode" placeholder="支行联行号"></el-input>
                    </el-form-item>
                    <el-form-item label="支付宝姓名" prop="username">
                        <el-input v-model="form.alipayName" placeholder="支付宝姓名"></el-input>
                    </el-form-item>
                    <el-form-item label="支付宝账号名" prop="username">
                        <el-input v-model="form.alipayAccountNumber" placeholder="支付宝账号名"></el-input>
                    </el-form-item>
                    <el-form-item label="微信姓名" prop="username">
                        <el-input v-model="form.weichatName" placeholder="微信姓名"></el-input>
                    </el-form-item>
                    <el-form-item label="微信账号" prop="username">
                        <el-input v-model="form.weichatAccountNumber" placeholder="微信账号"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺类型ID" prop="username">
                        <el-input v-model="form.typeId" placeholder="店铺类型ID"></el-input>
                    </el-form-item>
                    <el-form-item label="店铺类型名称" prop="username">
                        <el-input v-model="form.typeName" placeholder="店铺类型名称"></el-input>
                    </el-form-item> -->
                    <el-form-item label="地区code" prop="areaCode">
                        <el-input v-model="form.areaCode" placeholder="地区code"></el-input>
                    </el-form-item>
                    <!-- <el-form-item label="" prop="username">
                        <el-input v-model="form.areaDetail" placeholder=""></el-input>
                    </el-form-item> -->
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="cancel('form')">取 消</el-button>
                <el-button v-if="dialogStatus=='create'" type="primary" @click="create('form')">确 定</el-button>
                <el-button v-else type="primary" @click="update('form')">修 改</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
import {
  fetchList,
  addObj,
  putObj,
  getObj,
  delObj
} from "@/api/modules/shop/shop_store";
import waves from "@/directive/waves/index.js"; // 水波纹指令
import { mapGetters } from "vuex";

export default {
  name: "table_shop_store",
  directives: {
    waves
  },
  data() {
    return {
      list: null,
      total: null,
      listLoading: true,
      listQuery: {
        page: 1,
        limit: 20
      },
      rules: {},
      form: {
        storeId: undefined,
        storeName: undefined,
        storeAuth: undefined,
        areaId: undefined,
        storeAddress: undefined,
        storeLogo: undefined,
        storeDisplayVideo: undefined,
        areaCode: undefined
      },
      dialogFormVisible: false,
      dialogStatus: "",
      shop_store_add: false,
      shop_store_upd: false,
      shop_store_del: false,
      textMap: {
        update: "编辑",
        create: "创建"
      },
      tableKey: 0
    };
  },

  computed: {
    ...mapGetters(["permissions"])
  },
  filters: {
    statusFilter(status) {
      const statusMap = {
        0: "有效",
        1: "无效"
      };
      return statusMap[status];
    }
  },

  created() {
    this.getList();
    this.shop_store_add = this.permissions["shop_store_add"];
    this.shop_store_upd = this.permissions["shop_store_upd"];
    this.shop_store_del = this.permissions["shop_store_del"];
  },
  methods: {
       GetDic({
      commit,
      state,
      dispatch
    }, dic) {
      return new Promise((resolve, reject) => {
        if (dic instanceof Array) {
          Promise.all(dic.map(ele => getDic(ele))).then(data => {
            const result = {}
            dic.forEach((ele, index) => {
              result[ele] = data[index].data
            })
            resolve(result);
            console.log(1);
          })
        }
      })
    },
    getList() {
      this.listLoading = true;
      this.listQuery.isAsc = false;
      fetchList(this.listQuery).then(response => {
        this.list = response.data.records;
        this.total = response.data.total;
        this.listLoading = false;
      });
    },

    handleSizeChange(val) {
      this.listQuery.limit = val;
      this.getList();
    },
    handleCurrentChange(val) {
      this.listQuery.page = val;
      this.getList();
    },
    handleDelete(row) {
      delObj(row.id).then(response => {
        this.dialogFormVisible = false;
        this.getList();
        this.$notify({
          title: "成功",
          message: "删除成功",
          type: "success",
          duration: 2000
        });
      });
    },

    handleCreate() {
      this.dialogStatus = "create";
      this.dialogFormVisible = true;
    },
    // handleAuditing(){

    // }
    handleUpdate(row) {
        getObj(row.id).then(response => {
            this.form = response.data;
            this.dialogFormVisible = true;
            this.dialogStatus = "update";
            // this.role = [];
            this.form.storeId = row.storeId;
            this.form.storeName = row.storeName;
            this.form.storeAuth = row.storeAuth;
            this.form.areaId = row.areaId;
            this.form.storeAddress = row.storeAddress;
            this.form.storeLogo = row.storeLogo;
            this.form.storeDisplayVideo = row.storeDisplayVideo;
            this.form.areaCode = row.areaCode;
        });
    },


    create(formName) {
      const set = this.$refs;
      set[formName].validate(valid => {
        if (valid) {
          addObj(this.form).then(() => {
            this.dialogFormVisible = false;
            this.getList();
            this.$notify({
              title: "成功",
              message: "创建成功",
              type: "success",
              duration: 2000
            });
          });
        } else {
          return false;
        }
      });
    },
    cancel(formName) {
      this.dialogFormVisible = false;
      const set = this.$refs;
      set[formName].resetFields();
    },
    update(formName) {
      const set = this.$refs;
      this.form.role = this.role;
      set[formName].validate(valid => {
        if (valid) {
          this.dialogFormVisible = false;
          this.form.password = undefined;
          putObj(this.form).then(() => {
            this.dialogFormVisible = false;
            this.getList();
            this.$notify({
              title: "成功",
              message: "修改成功",
              type: "success",
              duration: 2000
            });
          });
        } else {
          return false;
        }
      });
    },
    resetTemp() {
      this.form = {
        id: undefined,
        role: [],
        delFlag: "",
        deptId: "",
        phone: ""
      };
    }
  }
};
</script>
